﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;

namespace RootfusHostView
{
    /// <summary>
    /// Base class for add-in items that will be placed on the Rootfus surface.
    /// </summary>
    public abstract class RootfusSurfaceItem
    {
        /// Return the WPF UIElement for this addin that is displayed when settings aren't selected.
        /// Return the WPF UIElement for this addin that is displayed when settings aren't selected.
        abstract public FrameworkElement SurfaceUI
        {
            get;
        }

        /// <summary>
        /// Return the UI element for configuration settings.
        /// </summary>
        abstract public FrameworkElement ConfigUI
        {
            get;
        }

        /// <summary>
        /// Called when the config is finished.
        /// </summary>
        abstract public void ConfigDone();

        /// <summary>
        /// Return true if you have a settings UI element - so we don't have to
        /// ask extra memory just to know...
        /// </summary>
        abstract public bool HasSettingsUI
        {
            get;
        }

        /// <summary>
        /// Return true if the main GUI is allowed to resize the surface item.
        /// </summary>
        abstract public bool SurfaceUIResizeAllowed
        {
            get;
        }

        /// <summary>
        /// Request a new resize for the item
        /// </summary>
        /// <param name="width"></param>
        /// <param name="height"></param>
        abstract public void RequestResize(double width, double height);

        /// Returns a list of the input and output pins
        abstract public IList<PinDefinition> InputPins
        {
            get;
        }
        abstract public IList<string> OutputPinNames
        {
            get;
        }

        /// <summary>
        /// Called when one of the inputs have changed and the guy should update its display.
        /// </summary>
        abstract public void Update();

        /// <summary>
        /// Called to set the callback guy that we can use!
        /// </summary>
        /// <param name="callback"></param>
        abstract public void SetCallback(SICallback callback);

        /// <summary>
        /// Return pin data as a root object.
        /// </summary>
        /// <param name="pin"></param>
        /// <returns></returns>
        abstract public ROOTObjectSpec GetPinDataAsROOTObject(string pin);

        /// <summary>
        /// Called when the config xml is changing. Update yourself! :-)
        /// </summary>
        /// <param name="xml_config"></param>
        abstract public void SetConfigXML(string xml_config);

    }
}
